package com.chaowen.xuefeng.index;

import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.WebView;

import com.chaowen.xuefeng.OABaseActivity;
import com.chaowen.yixin.R;

/**
 * 
 * @author lxj
 * 
 */
public class Index_Content_Webview extends OABaseActivity {
	private WebView webView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.oa_index_webview);
		this.setTitle("详细信息");
		initView();
	}

	private void initView() {
		webView = (WebView) findViewById(R.id.webView1);
		webView.getSettings().setJavaScriptEnabled(true);
		webView.loadUrl("http://www.baidu.com");
	}

	@Override
	// 默认点回退键，会退出Activity，需监听按键操作，使回退在WebView内发生
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		// TODO Auto-generated method stub
		if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.canGoBack()) {
			webView.goBack();
			return true;
		}
		return super.onKeyDown(keyCode, event);
	}
}
